import Vue from "vue"
import Vuex from "vuex"

Vue.use(Vuex)

import {mapState} from "vuex";

const state = {
  id: '',
  lendClass: {},
  userInfo: {
    avatarUrl: '',
    nickName: '',
    openid: '',
  },
}

const store = new Vuex.Store({
  state,
  mutations: {
    saveUserInfo(state, data) {
      state.userInfo = data
    },
    saveLendClass(state, data) {
      state.lendClass = data
    },
    saveId(state, data) {
      state.id = data
    }
  },
})

export default store


